import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {
    path:"/login",
    component:()=>import("../pages/login.vue"),
    meta:{
      title:"登录"
    }
  },
  {
    path:"/index",
    component:()=>import("../pages/index.vue"),
    meta:{
      title:"首页"
    },
    children:[
      {
        path:"home",
        component:()=>import("../views/home.vue"),
        meta:{title:"首页"}
      },
      {
        path:"menu",
        component:()=>import("../views/menu/menu.vue"),
        meta:{title:"菜单管理"}
      },
      {
        path:"role",
        component:()=>import("../views/role/role.vue"),
        meta:{title:"角色管理"}
      },
      {
        path:"user",
        component:()=>import("../views/user/user.vue"),
        meta:{title:"管理员管理"}
      },
      {
        path:"cate",
        component:()=>import("../views/cate/cate.vue"),
        meta:{title:"商品分类"}
      },
      {
        path:"specs",
        component:()=>import("../views/specs/specs.vue"),
        meta:{title:"商品规格"}
      },
      {
        path:"goods",
        component:()=>import("../views/goods/goods.vue"),
        meta:{title:"商品管理"}
      },
      {
        path:"member",
        component:()=>import("../views/member/member.vue"),
        meta:{title:"会员管理"}
      },
      {
        path:"banner",
        component:()=>import("../views/banner/banner.vue"),
        meta:{title:"轮播图管理"}
      },
      {
        path:"seck",
        component:()=>import("../views/seck/seck.vue"),
        meta:{title:"秒杀活动"}
      },
      {
        path:"",
        redirect:"home"
      }
    ]
  },
  {
    path:"*",
    redirect:"/login"
  }
]

const router = new VueRouter({
  routes
})

export default router
